/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package action.administration;

import java.util.Comparator;

/**
 *
 * @author Trang
 */
public class MarkovItem implements Comparable<MarkovItem>{
    private double bid;
    private double value;
    private double budget;
    private double policyConvert;
    private double policyNotConvert;
    private double optimalPolicy;
    private double notConvert;
    private String keyword;
    public MarkovItem(String keyword, double policyConvert, double policyNotConvert, double optimalPolicy, double budget)
    {
        this.keyword = keyword;
        this.optimalPolicy = optimalPolicy;
        this.budget = budget;
        this.policyConvert = policyConvert;
        this.policyNotConvert = policyNotConvert;
    }
    public MarkovItem()
    {
        
    }
    public MarkovItem(String keyword, double optimalPolicy)
    {
        this.keyword = keyword;
        this.optimalPolicy = optimalPolicy;
    }
    /**
     * @return the bid
     */
    public double getBid() {
        return bid;
    }

    /**
     * @param bid the bid to set
     */
    public void setBid(double bid) {
        this.bid = bid;
    }

    /**
     * @return the value
     */
    public double getValue() {
        return value;
    }

    /**
     * @param value the value to set
     */
    public void setValue(double value) {
        this.value = value;
    }

    /**
     * @return the budget
     */
    public double getBudget() {
        return budget;
    }

    /**
     * @param budget the budget to set
     */
    public void setBudget(double budget) {
        this.budget = budget;
    }

    /**
     * @return the policyConvert
     */
    public double getPolicyConvert() {
        return policyConvert;
    }

    /**
     * @param policyConvert the policyConvert to set
     */
    public void setPolicyConvert(double policyConvert) {
        this.policyConvert = policyConvert;
    }

    /**
     * @return the policyNotConvert
     */
    public double getPolicyNotConvert() {
        return policyNotConvert;
    }

    /**
     * @param policyNotConvert the policyNotConvert to set
     */
    public void setPolicyNotConvert(double policyNotConvert) {
        this.policyNotConvert = policyNotConvert;
    }

    /**
     * @return the optimalPolicy
     */
    public double getOptimalPolicy() {
        return optimalPolicy;
    }

    /**
     * @param optimalPolicy the optimalPolicy to set
     */
    public void setOptimalPolicy(double optimalPolicy) {
        this.optimalPolicy = optimalPolicy;
    }

    /**
     * @return the notConvert
     */
    public double getNotConvert() {
        return notConvert;
    }

    /**
     * @param notConvert the notConvert to set
     */
    public void setNotConvert(double notConvert) {
        this.notConvert = notConvert;
    }

    /**
     * @return the keyword
     */
    public String getKeyword() {
        return keyword;
    }

    /**
     * @param keyword the keyword to set
     */
    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }
    
//                public double compareTo(MarkovItem o1, MarkovItem o2) {
//        return new Double (o1.getOptimalPolicy()).compareTo(o2.getOptimalPolicy());
//    }
    @Override
                public int compareTo(MarkovItem compareFruit) {
                            Double first =  this.getOptimalPolicy();
                            Double second = compareFruit.getOptimalPolicy();
                            return first.compareTo(second);
 
	}

//    @Override
//    public int compare(MarkovItem o1, MarkovItem o2) {
//        double different = o1.getOptimalPolicy() - o2.getOptimalPolicy();
//        if(different > 0)
//            return 1;
//        else if(different < 0)
//            return -1;
//        else return 0;
//    }

//    @Override
//    public int compareTo(MarkovItem o) {
//        double different = this.optimalPolicy - o.getOptimalPolicy();
//        if(different > 0)
//            return 1;
//        else if(different < 0)
//            return -1;
//        else return 0; //To change body of generated methods, choose Tools | Templates.
//    }
    
}
 
